from typing import Optional, List

from pydantic import BaseModel

class save_data(BaseModel):
    add: list = [{
        "DvpUnit_Name":'str',
        "DvpUnit_OilStim_PlanProj_Name":'str',
        "StimPlanProj_StartYear":'str=2021-03-19',
        "StimPlanProj_EndYear":'str=2021-03-19',
        "StimPlanProj_Outline":"str",
        'userName': 'str'
    }]
    delete: list=[{
        "DvpUnit_OilStim_PlanProj_ID":"str",
        "DvpUnit_Name":'str',
        "DvpUnit_OilStim_PlanProj_Name":'str'
    }]
    modify:list=[{
        "DvpUnit_OilStim_PlanProj_ID":"str",
        "DvpUnit_Name":'str',
        "DvpUnit_OilStim_PlanProj_Name":'str',
        "StimPlanProj_StartYear":'str=2021-03-19',
        "StimPlanProj_EndYear":'str=2021-03-19',
        "StimPlanProj_Outline":"str"
    }]

class save_tb_year_dvpunit_oilstim_planproj_basic_model(BaseModel):
    DvpUnit_OilStim_PlanProj_ID: str
    DvpUnit_Name: str
    DvpUnit_OilStim_PlanProj_Name: str
    StimPlanProj_StartYear: str
    StimPlanProj_EndYear: str
    StimPlanProj_Outline: str

class save_tb_year_dvpunit_oilstim_planproj_basic_datas(BaseModel):
    save: Optional[List[save_tb_year_dvpunit_oilstim_planproj_basic_model]] = None
    modify: Optional[List[save_tb_year_dvpunit_oilstim_planproj_basic_model]] = None
    delete: Optional[List[save_tb_year_dvpunit_oilstim_planproj_basic_model]] = None


class save_tb_year_dvpunit_oilstim_planproj_forecast_model(BaseModel):
    DvpUnit_OilStim_PlanProj_Name:str
    DvpUnit_Name:str
    Year:str
    StimType_Name:str
    Forecast_Method:str
    Stim_WellValidRatio:int
    Stim_WellNumber_Valid:int
    Stim_ValidPeriod_Average:int
    Stim_IncreOil_Average:float
    Update_Date:str
    Remark:Optional[str]=None

class save_tb_year_dvpunit_oilstim_planproj_forecast_datas(BaseModel):
    save: Optional[List[save_tb_year_dvpunit_oilstim_planproj_forecast_model]] = None
    modify: Optional[List[save_tb_year_dvpunit_oilstim_planproj_forecast_model]] = None
    delete: Optional[List[save_tb_year_dvpunit_oilstim_planproj_forecast_model]] = None

class save_tb_oilwellstim_planproj_forecast_model(BaseModel):
    DvpUnit_OilStim_PlanProj_Name: str
    Well_Name: str
    Year: str
    StimType_Name: str
    Forecast_Method:str
    Stim_ValidPeriod:int
    Stim_IncreOil:float
    Update_Date:str
    Remark:Optional[str]=None

class save_tb_oilwellstim_planproj_forecast_datas(BaseModel):
    save: Optional[List[save_tb_oilwellstim_planproj_forecast_model]] = None
    modify: Optional[List[save_tb_oilwellstim_planproj_forecast_model]] = None
    delete: Optional[List[save_tb_oilwellstim_planproj_forecast_model]] = None

class save_tb_year_dvpunit_planproj_oilstim_cost_model(BaseModel):
    DvpUnit_OilStim_PlanProj_Name: str
    DvpUnit_Name: str
    Year: str
    StimType_Name: str
    Stim_Cost:float
    Remark:Optional[str]=None

class save_tb_year_dvpunit_planproj_oilstim_cost_datas(BaseModel):
    save: Optional[List[save_tb_year_dvpunit_planproj_oilstim_cost_model]] = None
    modify: Optional[List[save_tb_year_dvpunit_planproj_oilstim_cost_model]] = None
    delete: Optional[List[save_tb_year_dvpunit_planproj_oilstim_cost_model]] = None

class save_tb_year_dvpunit_planproj_oilprice_model(BaseModel):
    DvpUnit_OilStimulate_PlanProj_Name: str
    DvpUnit_Name: str
    Year: str
    Oil_CommodityRatio:float
    Oil_Price:float
    Remark:Optional[str]=None

class save_tb_year_dvpunit_planproj_oilprice_datas(BaseModel):
    save: Optional[List[save_tb_year_dvpunit_planproj_oilprice_model]] = None
    modify: Optional[List[save_tb_year_dvpunit_planproj_oilprice_model]] = None
    delete: Optional[List[save_tb_year_dvpunit_planproj_oilprice_model]] = None

class u_p_id(BaseModel):
    DvpUnit_Name : list
    PlanProj_Name : list

class up_id(BaseModel):
    user_id:str
    proj_id:str

class page_data(BaseModel):
    user_id: str
    proj_id: str
    page:str
    remark:Optional[str]=None

class save_tb_year_dvpunit_planproj_oilprodcost_model(BaseModel):
    DvpUnit_OilStim_PlanProj_Name:str
    DvpUnit_Name:str
    Year:str
    Oil_OprCost:float
    FuelCost:float
    Power_Cost:float
    FluidDispose_Cost:float
    OilDisplaceAgent_Cost:float
    NGLRecovery_Cost:float
    Transp_Cost:float
    WellTest_Cost:float
    Other_Cost:float
    Depreciation_Cost:float
    Remark:Optional[str]=None

class save_tb_year_dvpunit_planproj_oilprodcost_datas(BaseModel):
    save: Optional[List[save_tb_year_dvpunit_planproj_oilprodcost_model]] = None
    modify: Optional[List[save_tb_year_dvpunit_planproj_oilprodcost_model]] = None
    delete: Optional[List[save_tb_year_dvpunit_planproj_oilprodcost_model]] = None

class save_tb_year_dvpunit_planproj_discount_model(BaseModel):
    DvpUnit_OilStimulate_PlanProj_Name:str
    DvpUnit_Name:str
    Year:str
    Money_Discount:float
    Remark:Optional[str]=None

class save_tb_year_dvpunit_planproj_discount_datas(BaseModel):
    save: Optional[List[save_tb_year_dvpunit_planproj_discount_model]] = None
    modify: Optional[List[save_tb_year_dvpunit_planproj_discount_model]] = None
    delete: Optional[List[save_tb_year_dvpunit_planproj_discount_model]] = None

class save_tb_year_dvpunit_oilsalecost_ratio_model(BaseModel):
    DvpUnit_OilStim_PlanProj_Name:str
    DvpUnit_Name:str
    Year:str
    OilSale_TotalTaxRatio:float
    AddedValue_TaxRatio:float
    Resource_TaxRatio:float
    EduAdd_TaxRatio:float
    CityDvpAdd_TaxRate:float
    Income_TaxRate:float
    ManageCost_Ratio:float
    Remark:Optional[str]=None

class save_tb_year_dvpunit_oilsalecost_ratio_datas(BaseModel):
    save: Optional[List[save_tb_year_dvpunit_oilsalecost_ratio_model]] = None
    modify: Optional[List[save_tb_year_dvpunit_oilsalecost_ratio_model]] = None
    delete: Optional[List[save_tb_year_dvpunit_oilsalecost_ratio_model]] = None

class save_tb_year_dvpunit_oilstim_planproj_evaluate_result_model(BaseModel):
    DvpUnit_OilStim_PlanProj_Name:str
    DvpUnit_Name:str
    Year:str
    StimType_Name:str
    Stim_WellValidRatio:int
    Stim_WellNumber_Valid:int
    Stim_ValidPeriod_Average:int
    Stim_IncreOil_Average:float
    StimOil_CommodityRatio:float
    Oil_Price:float
    OilSale_TotalTaxRatio:float
    Money_Discount:float
    Oil_OprCost:float
    StimCost_Average:float
    StimOil_WellOprCost_Average:float
    StimOil_Total_Tax_Average:float
    StimOil_Gross_SalesIncome_Average:float
    StimOil_Static_Gains_Average:float
    StimOil_NPV_Average:float
    StimOil_ROI:float
    StimOil_NPVR:float
    StimOil_FIRR:float
    Stim_IncreOil_Critical_Average:float
    StimOil_Price_Critical:float
    Remark:Optional[str]=None


class save_tb_year_dvpunit_oilstim_planproj_evaluate_result_datas(BaseModel):
    save: Optional[List[save_tb_year_dvpunit_oilstim_planproj_evaluate_result_model]] = None
    modify: Optional[List[save_tb_year_dvpunit_oilstim_planproj_evaluate_result_model]] = None
    delete: Optional[List[save_tb_year_dvpunit_oilstim_planproj_evaluate_result_model]] = None

class save_well_proj_evaluate_result_model(BaseModel):
    DvpUnit_OilStim_PlanProj_Name:str
    Well_Name:str
    Year:str
    StimType_Name:str
    Stim_ValidPeriod:int
    Stim_IncreOil:float
    StimOil_CommodityRatio:float
    Oil_Price:float
    OilSale_TotalTaxRatio:float
    Money_Discount:float
    Oil_OprCost:float
    StimCost:float
    StimOil_WellOprCost:float
    StimOil_Total_Tax:float
    StimOil_Gross_SalesIncome:float
    StimOil_Static_Gains:float
    StimOil_NPV:float
    StimOil_ROI:float
    StimOil_NPVR:float
    StimOil_FIRR:float
    Stim_IncreOil_Critical:float
    StimOil_Price_Critical:float
    Remark:Optional[str]=None


class save_well_proj_evaluate_result_datas(BaseModel):
    save: Optional[List[save_well_proj_evaluate_result_model]] = None
    modify: Optional[List[save_well_proj_evaluate_result_model]] = None
    delete: Optional[List[save_well_proj_evaluate_result_model]] = None